package com.cisc.business.order.service;

import com.cisc.business.product.dto.ProductInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @description: XXX
 * @author: daizh
 * @time: 2021/6/20 14:26
 */
@FeignClient(name = "product-service")
public interface ProductService {
    /**
     * @param productId
     * @return
     */
    @GetMapping("/product/productId/{productId}")
    public ProductInfo getProductByProductId(@PathVariable("productId") Integer productId);

    /**
     * @param productCode
     * @return
     */
    @GetMapping("/product/productCode/{productCode}")
    public ProductInfo getProductByProductCode(@PathVariable("productCode") String productCode);

    /**
     * @return
     */
    @GetMapping("/product/allProdcut")
    public List<ProductInfo> getAllProducts();

    /**
     * @param productInfo
     * @return
     */
    @PostMapping("/product/saveProduct")
    public String saveProduct(@RequestBody ProductInfo productInfo);
}
